<template>
  <div class="jindu">
    <div class="el_menu_body">
      <el-menu
        :default-active="activeIndex"
        class="el-menu-demo el_menu"
        mode="horizontal"
        background-color="#F2F5F4"
        @select="handleSelect"
      >
        <el-menu-item index="0">&nbsp;待查看&nbsp;</el-menu-item>
        <el-menu-item index="1">&nbsp;已查看&nbsp;</el-menu-item>
        <el-menu-item index="3">&nbsp;约面试&nbsp;</el-menu-item>
        <el-menu-item index="5">&nbsp;不合适&nbsp;</el-menu-item>
      </el-menu>
    </div>
    <div class="content">
      <el-table :data="tableData" stripe style="width: 100%">
        <!-- <el-table-column prop="date" label="日期" width="180"></el-table-column> -->
        <el-table-column prop="job" label="职位" width="270"></el-table-column>
        <el-table-column prop="cname" label="公司" width="300"></el-table-column>
        <!-- <el-table-column prop="state" label="职位状态" width="100"></el-table-column> -->
        <el-table-column prop="address" label="地址" width="450"> </el-table-column>
        <el-table-column prop="sal" label="薪资" width="180"> </el-table-column>
      </el-table>

    </div>
  </div>
</template>
<style>
.jindu {
  width: 100%;
  height: calc(100vh - 40px);
  background-color: white;
}
.el_menu_body {
  width: 100%;
  height: 55px;
  background-color: #f2f5f4;
}
.el_menu {
  margin: 0px calc(50vw - 600px);
}
.el-menu-item {
  height: 54px !important;
}
.content {
  width: 1200px;
  height: calc(100vh - 116px);
  margin: 20px calc(50vw - 600px);
  border: 1px rgb(211, 210, 210);
  border-style: solid dashed none dashed;
}
</style>
<script>
export default {
  data() {
    return {
      activeIndex: "0",
      tableData: [],
    };
  },
  methods: {
    handleSelect(state) {
      console.log("状态：",state);
      var id = this.$store.state.userId;
      console.log("获取userId:",id)
      var url = this.$store.state.ip + "/userRe/userReU";
      // 参数
      let param = new URLSearchParams();
      param.append("uid", id);
      param.append("state", state);
      this.$axios({
        method: "post",
        url: url,
        data: param,
      }).then((res) => {
        console.log(res.data);
        this.tableData = res.data;
      });
    },
  },
  beforeMount(){
    this.handleSelect(0);
  },
};
</script>